package com.cari.oa.domain;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 系统用户角色关系实体类
 * User: yexuhui
 * Date: 12-12-12
 * Time: 下午9:08
 */
@Entity
@Table(name = "T_SYS_USER_ROLE_REL")
public class SysUserRoleRelEntity implements Serializable {

    private static final long serialVersionUID = -8044192006938075668L;

    @Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;

    @NotNull(message = "系统用户名不能为空")
    @Length(max = 32, min = 4, message = "系统用户名长度在4~32个字符之间")
    @Column(name = "user_name")
    private String userName;

    @NotNull(message = "角色名不能为空")
    @Length(max = 32, message = "角色名长度要小于32个字符")
    @Column(name = "role_name")
    private String roleName;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
}
